//
//  UIDefines.h
//  FrameWork
//
//  Created by 李刚 on 2017/5/9.
//  Copyright © 2017年 李刚. All rights reserved.
//

#ifndef UIDefines_h
#define UIDefines_h

#define kNot_real_Name @"尚未认证，前去实名认证"
#define kAuthentication @"认证中，请耐心等待"
#define kNot_KT_Hy @"尚未开通会员"

// 版本信息
#define kSystemVersion  [UIDevice.currentDevice.systemVersion floatValue]
#define iOS9Later       (kSystemVersion >= 9.0f)
#define iOS10Later      (kSystemVersion >= 10.0f)
#define iOS11Later      (kSystemVersion >= 11.0f)


// 获得屏幕宽高
#define kScreenWidth                                [UIScreen mainScreen].bounds.size.width
#define App_Bounds                                  [UIScreen mainScreen].bounds
#define kScreenHeight                               [UIScreen mainScreen].bounds.size.height
#define kNavigationHeight                           (iphoneX ? 88 : 64)
#define kBottomBarHeight                            (iphoneX ? 83.f : 49.f)
#define kContentHeight                              (kScreenHeight - kNavigationHeight)
#define kTabbarSafeBottomMargin                     (iphoneX ? 34.f : 0.f)

#define kScale                  kScreenWidth/375.0f
#define kScaling(f)             kScale * f
#define kScalingH               kScreenHeight/667.0f

// 手机型号
#define iphone4_3_5     ([UIScreen mainScreen].bounds.size.height<500.0f)
#define iphone5_4_0     ([UIScreen mainScreen].bounds.size.height==568.0f)
#define iphone6_4_7     ([UIScreen mainScreen].bounds.size.height==667.0f)
#define iphonePlus_5_5  ([UIScreen mainScreen].bounds.size.height>700.0f)
#define iphoneX         ([UIScreen mainScreen].bounds.size.height>800.0f)


// 获得RGB颜色
#define kColorWithRGB(r, g, b)          [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define kColorRGBAlpha(r, g, b, a)      [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define kColorWithFloat(rgbValue) \
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \
green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \
blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0]


// 主要颜色
#define kColorSeparator             (kColorWithFloat(0xCCCCCC))   // 分割线
#define kColorHighlighted           (kColorWithFloat(0xf2f2f2))   // Cell高亮
#define kColorDisable               (kColorWithFloat(0xCCCCCC))
#define kColorBackground            (kColorWithFloat(0xeeeeee))   // 界面背景色
#define kColorMainTheme             (kColorWithFloat(0x662e29))   // 主题色
#define kColorGray                  (kColorWithFloat(0xdddddd))   // 中灰
#define kColorLightGray             (kColorWithFloat(0xb3b3b3))   // 浅灰

#define kColorText                  (kColorWithFloat(0x666666))   // 浅灰
#define kColorDefult                (kColorWithFloat(0x333333))   // 浅灰


#define klText @"加载中"
#define klError @"网络加载失败"
#define kPhotoURL(string) [NSURL URLWithString:string]
#define kMoeny(string) [NSString stringWithFormat:@"¥ %@",string]
#define kAliPayScuess @"kAliPayScuess"

//oss 配置项URL 公司测试环境域名
#define isDegug 1
#define kOSSBucketKey isDegug == 1 ? @"id-photo" : @"pro-file-store"
#define kxBase_URL isDegug == 1 ? @"http://119.23.21.33:8000" : @"http://192.168.11.127:8000"
#define kPHPBase_URL @"http://47.106.100.253/"//http://47.106.100.253/  http://test.boss.szqqkj.cn
#define KPHP_Url(string)    [NSString stringWithFormat:@"%@%@",kPHPBase_URL,string]

//#define kOSSBucketKey       [[NSUserDefaults standardUserDefaults] objectForKey:@"OSS"]
//#define kxBase_URL          ((NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:@"server"])
//#define kH5Base_URL         [[NSUserDefaults standardUserDefaults] objectForKey:@"webServer"]
#define KBaseURL(string)    [NSString stringWithFormat:@"%@/%@",kxBase_URL,string]

//百度配置项
#define kBDApiKey           @"vBKdNNiVLmjVh3VR7LPGyXhb"
#define kSecretKey          @"VC1q9RpSTCyYpEbNgo4QX98q6ASZtL8c"

//#define KBaseURL(string)    [NSString stringWithFormat:@"%@/api/%@",kxBase_URL,string]
#define kisStrNiL(string)   string.length != 0 ? string : @""

#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;

#define randomColor [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1]


// 自定义Log
#ifdef DEBUG
//#define NSLog(format, ...)  do{ \
//fprintf(stderr, "<文件来源: %s : 第%d行>\n<当前方法: %s>\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__LINE__, __func__); \
//(NSLog)((@"\n"@"输出结果: "format), ##__VA_ARGS__); \
//fprintf(stderr, "******************分界线*****************\n\n"); \
//} while(0); \

#else
#define NSLog(format, ...)
#endif


#endif /* UIDefines_h */
